package com.swyc.osschat.Test.designMode.factory.fac;

import com.swyc.osschat.Test.designMode.factory.base.ACar;
import com.swyc.osschat.Test.designMode.factory.base.BCar;
import com.swyc.osschat.Test.designMode.factory.base.Car;
import com.swyc.osschat.Test.designMode.factory.impl.Bora;
import com.swyc.osschat.Test.designMode.factory.impl.Sagitar;

/**
 * @description 工厂
 * @Author: z156940l@outlook.com
 * @className CarFactory
 * @Date: 2022/7/25 22:25
 */
public abstract class CarFactory{
    public static Car getCar(String carType){
        switch (carType){
            case "bora":
                return new Bora();
            case "sagitar":
                return new Sagitar();
            default:
                return null;
        }
    }

    public abstract Car getCar();
    public abstract ACar createACar();
    public abstract BCar createBCar();
}
